package com.example.pungolo.journal.model;

import com.example.pungolo.journal.R;

public enum Mood {
  happy(1, R.drawable.mood_happy),
  sad(2, R.drawable.mood_sad),
  angry(3, R.drawable.mood_angry),
  kiss(4, R.drawable.mood_kiss),
  cool(5, R.drawable.mood_cool),
  angel(6, R.drawable.mood_angel),
  crying(7, R.drawable.mood_crying),
  devil(8, R.drawable.mood_devil),
  embarassed(9, R.drawable.mood_embarassed),
  laugh(10, R.drawable.mood_laugh),
  raspberry(11, R.drawable.mood_raspberry),
  smirk(12, R.drawable.mood_smirk),
  surprise(13, R.drawable.mood_surprise),
  tired(14, R.drawable.mood_tired),
  uncertain(15, R.drawable.mood_uncertain),
  worried(16, R.drawable.mood_worried);
  
  public final int id;
  public final int res;
  Mood(int id, int res) {
    this.id = id;
    this.res = res;
  }
  public static Mood getMoodFromId(int id) {
    Mood[] moods = Mood.values();
    for (Mood m : moods) {
      if (m.id == id)
        return m;
    }
    return null;
  }
  public static Mood getMoodFromRes(int res) {
    Mood[] moods = Mood.values();
    for (Mood m : moods) {
      if (m.res == res)
        return m;
    }
    return null;
  }
}
